package arie.simplexample.domain;

import java.util.GregorianCalendar;

public class Person {
	
	String firstname,lastname;
	int age;
	
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return 
				lastname;
	}
	/*
	 * 
	 * @param lastname
	 */
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	
	public int calculateBirthYear() throws Exception{
		if (age>0){
			return (GregorianCalendar.getInstance().get(GregorianCalendar.YEAR)) - age;
		} else {
			throw new Exception("Age not greather then 0");
		}
	}

}
